package com.twoGroup.boot.mapper;

import com.twoGroup.boot.pojo.Comment;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Map;

@Repository
@Mapper
public interface CommentMapper {
    //进行评论
    Integer doComment(Comment comment);
    //分页查询商品品评论
    List<Map<String, Object>> queryForComment(@Param("goodsId") Integer goodsId, @Param("pageNow") Integer pageNow, @Param("pageSize") Integer pageSize);
    //分页查询用户评论
    List<Map<String, Object>> queryForUserComment(@Param("userId") Integer userId, @Param("pageNow") Integer pageNow, @Param("pageSize") Integer pageSize);
    //其它用户对该评论点赞
    Integer giveLike(Comment comment);
    //查询所有的评论
    Integer queryForAllCount(Integer goodsId);

    Integer queryForAllUserCount(Integer userId);

    Integer queryForNotComment(Integer userId);

    List<Map<String, Object>> queryForUserNotComment(Integer userId, Integer pageNow, Integer pageSize);
}
